package sctu.edu.java.year2016.team07.wenjia.day20160522.chapter5_2;

/**
 * Created by 001 on 2016/5/22.
 * 创建一个arr数组，并输出数组最大值
 */
public class shuchuzuidazhi {
    public static void main(String[]args) {
        int arr[] = {13, 22, 24, 37, 56};
        int i, j;
        int max = arr[0];
        for (i = 0; i < arr.length; i++) {
            System.out.print(+arr[i] + "\t");
        }
         max= arr[0];
        for (j = 0; j < arr.length - 1; j++) {
            max =max > arr[j+1] ? max : arr[j+1];

        }

      System.out.println("最大数组元素值是："+max);

}}
